-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT]: Implement an array sorting script #116
Conversation
hey @coxmars kindly review :) |
Hi @martinvibes, can you add a .tool-versions file with the Scarb and Starknet foundry versions you are using? |
@coxmars i have added it sir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add small tests for each sorting (2 edge cases at least) to validate that they all work correctly and add a screenshot.
Alright sir on it |
hello @coxmars i have written tests for them and all tests are passing :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local verification done, all good. Ready for second review. @danielcdz π―
hello @danielcdz i have implemented required change π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
π Pull Request Title
[FEAT]: Implement Sorting Algorithms
π οΈ Issue
Closes #105
π Description
This PR implements sorting algorithms to provide efficient array sorting capabilities. The implementation includes:
Created interface.cairo defining Sortable and SortableVec traits for consistent sorting interfaces
Implemented QuickSort algorithm with optimized pivot selection
Added Alexandria data structures as a dependency for vector operations
Structured the code in a modular way with separate files for interface and implementation
Fixed compilation issues and imports
Added proper error handling for edge cases (empty arrays, single elements)
πΌοΈ Screenshots
N/A - Implementation is code-only
π Additional Notes
The implementation supports both array and vector-based sorting
The code is prepared for future additions of other sorting algorithms
Tested with various input sizes and types
All files include proper documentation and type annotations